package populus.core.queue;
/**
 * 记录url和当前url的深度
 * @author burkun
 *
 */
public class UrlItem implements Comparable{
	private String url;
	private int depth;
	
	public UrlItem(String url, int depth){
		this.url = url;
		this.depth = depth;
	}
	
	@Override
	public int hashCode() {
		return url.hashCode();
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getDepth() {
		return depth;
	}

	public void setDepth(int depth) {
		this.depth = depth;
	}
	/**
	 * compare two urlitems equal or not  [1 for equal, 0 for not equal] 
	 * 
	 * @author mingchen
	 */
	public int compareTo(Object arg0) {
		UrlItem url = (UrlItem) arg0;
		if (this.url.trim().equalsIgnoreCase(url.getUrl().trim())){
			return 1;
		}
		return 0;
	}
	
}
